<template>
  <div class="container">
    <button @click="getStudents">获取学生信息</button>
	<button @click="getCars">获取汽车信息</button>
	<Search />
	<List />
  </div>
</template>

<script>
import axios from 'axios'
import Search from './components/Search.vue'
import List from './components/List.vue'

export default {
  name: 'App',
  components: {
    Search,List
  },
  methods:{
	  getStudents(){
		  axios.get('http://127.0.0.1:8080/server/student').then(response => {
			  console.log('请求成功了',response.data)
		  },error => {
			  console.error('请求失败了',error.msg)
		  })
	  },
	  getCars(){
		  axios.get('http://127.0.0.1:8080/demo/cars').then(response => {
			  console.log('请求成功了',response.data)
		  },error => {
			  console.error('请求失败了',error.msg)
		  })
	  },
  }
}
</script>

<style scoped>
</style>
